<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-06-10 16:01:06
 * @Description: 物流公司
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-09-17 10:00:10
 * @FilePath: /qingshanERP/database/migrations/qingshanerp/2021_06_10_160106_create_logistics.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLogistics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('logistics', function (Blueprint $table) {
            $table->id();
            $table->foreignId('tenant_id')->default(0)->comment('租户id');
            $table->foreignId('shop_id')->default(0)->comment('用户id');
            $table->tinyInteger('type')->default(1)->comment('平台类型，1 淘宝，2 天猫，3 京东，4 拼多多');
            $table->string('logistics_company', 100)->comment('快递公司名称');
            $table->string('logistics_id', 100)->default(0)->comment('快递公司编码');
            $table->string('logistics_code', 100)->default(0)->comment('物流公司代码');
            $table->string('standard_template_name', 255)->default('a')->comment('电子面单模板名称');
            $table->string('standard_template_url', 255)->default('a')->comment('电子面单模板地址');
            $table->string('country', 100)->default('中国')->comment('国家');
            $table->string('province', 100)->default('中国')->comment('省份');
            $table->string('city', 100)->default('中国')->comment('城市');
            $table->string('district', 100)->default('中国')->comment('区');
            $table->string('detail', 255)->default('中国')->comment('地址');
            $table->dateTime('last_at')->useCurrent()->comment('最后更新时间');
            $table->boolean('status')->default(1)->comment('状态，1 正常，0 禁用');
            $table->boolean('del_flag')->default(0)->comment('删除状态，1 删除，0 未删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('logistics');
    }
}
